<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //利用构造函数方法：Array.from()将类数组或可遍历对象转换为真正的数组
        var arrayLike = {
            '0':'张三',
            '1':'李四',
            '2':'王五',
            "length":3
        };
        var ary2 = Array.from(arrayLike);
        console.log(ary2);

        let arrayLIke1 = {
            '0':1,
            '1':2,
            'length':2
        };
        let newAry1 = Array.from(arrayLIke1,item =>item*2);
        console.log(newAry1);
    </script>
</body>
</html>